/*
 * Motor.h
 *
 *  Created on: Apr 12, 2010
 *      Author: andrew
 */

#ifndef MOTOR_H_
#define MOTOR_H_

class Motor {
	double V0,V,Kv,I0,R,Kt;
	int N;

public:
	/**
	 * Constructor with inputs:
	 * Voltage
	 * Kv - linear relationship between motor speed (rpm) and applied voltage
	 * I0 - no load current at given voltage
	 * R - armature resistance
	 * N - number of motors
	 */
	Motor(double Voltage, double Kv, double I0, double R, int N);

	/**
	 * set throttle seting (between 0 and 1)
	 */
	void setThrottle(double throttle);

	/**
	 * maximum number of RPMs
	 */
	double getMaxRPM();

	/**
	 * number of motors
	 */
	int getNumberOfMotors();
	/**
	 * power drawn into motor in Watts
	 */
	double getPowerIn(double RPM);

	/**
	 * power output of motor in Watts
	 */
	double getPowerOut(double RPM);

	/**
	 * motor efficiency
	 */
	double getEfficiency(double RPM);

	/**
	 * torque generated by motor in N-m
	 */
	double getTorque(double RPM);


};

#endif /* MOTOR_H_ */
